<!DOCTYPE html>
<html lang="en">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport"
		content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no" />
	<meta name="format-detection" content="telephone=no" />
	<meta name="format-detection" content="email=no" />
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Cache-Control" content="no-cache" />
	<meta http-equiv="Expires" content="0" />
	<title>患者档案-影像学检查</title>
	<!-- 引入 vant UI 组件库样式文件 -->
	<link rel="stylesheet" href="../../common/css/vant-index.css" />
	<!-- 引入 viewer 图片预览样式文件 -->
	<link href="../../common/css/viewer.css" rel="stylesheet" />
	<style rel="stylesheet">
		body {
			background-color: #f7f8fa;
		}

		a {
			-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
		}

		a:-webkit-any-link {
			color: #eee;
		}

		img {
			max-width: 45%;
		}

		.container {
			border: 1px solid #f5f5f5;
			box-shadow: -1px 5px 5px #ececec;
			border-radius: 10px;
			/* margin: 0.6rem; */
			padding: 0;
		}

		.van-cell-group--inset {
			margin: 0;
		}

		.lists,
		.texts {
			color: #8c8c8c;
		}

		.texts {
			margin-top: 0.3rem;
		}

		.tab-btn {
			margin: 0.2rem;
			height: 1.7rem;
			line-height: 1.7rem;
		}

		.images-list {
			margin-top: 1rem;
			display: flex;
			flex-flow: wrap;
			align-content: flex-start;
		}

		.image-item {
			margin: 0.2rem;
			flex: 1;
		}
	</style>
</head>

<body>
	<div id="app" v-cloak>
		<div class="container">
			<van-nav-bar title="影像学检查" left-text="返回" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
				<template #right>
					<van-icon name="wap-home-o" size="18" />
				</template>
			</van-nav-bar>
			<van-cell-group inset>
				<van-cell>
					<template #title>
						<span class="custom-title">下肢血管CTA</span>
					</template>
					<template #value>
						{{currentData.extremityVesselCta == 1 ? '正常' :
						currentData.extremityVesselCta == 2 ?
						'提示下肢血管病变' : currentData.extremityVesselCta
						== 3 ? currentData.extremityVesselCtaOther : '--'}}
					</template>
				</van-cell>
				<van-cell>
					<template #title>
						<span class="custom-title">下肢血管DSA</span>
					</template>
					<template #value>
						{{currentData.extremityVesselDsa == 1 ? '正常' :
						currentData.extremityVesselDsa == 2 ?
						'提示下肢血管病变' : currentData.extremityVesselDsa
						== 3 ? currentData.extremityVesselDsaOther : '--'}}
					</template>
				</van-cell>
				<van-cell>
					<template #title>
						<span class="custom-title">下肢血管MRI</span>
					</template>
					<template #value>
						{{currentData.extremityVesselMri == 1 ? '正常' :
						currentData.extremityVesselMri == 2 ?
						'提示下肢血管病变' : currentData.extremityVesselMri
						== 3 ? currentData.extremityVesselMriOther : '--'}}
					</template>
				</van-cell>
				<van-cell>
					<template #title>
						<span class="custom-title">下肢血管B超</span>
					</template>
					<template #value>
						{{currentData.extremityVesselBi == 1 ? '正常' :
						currentData.extremityVesselBi == 2 ?
						'提示下肢血管病变' : currentData.extremityVesselBi
						== 3 ? currentData.extremityVesselBiOther : '--'}}
					</template>
				</van-cell>
				<van-cell>
					<div class="text">足X线</div>
					<div class="lists" v-if="currentData.footXray != null">
						{{currentData.footXray.indexOf('1') != -1 ? '正常' :
						''}} {{currentData.footXray.indexOf('2') != -1 ?
						'骨髓炎' : ''}} {{currentData.footXray.indexOf('3')
						!= -1 ? ' 夏科式关节' : ''}}
						{{currentData.footXray.indexOf('4') != -1 ?
						currentData.footXrayOther : ''}}
					</div>
				</van-cell>
				<van-cell>
					<div class="text">其它</div>
					<div>{{currentData.other}}</div>
				</van-cell>
				<van-cell>
					<template #title>
						<span class="custom-title">检查报告名称</span>
					</template>
					<template #value> {{currentData.reportName}} </template>
				</van-cell>
				<van-cell>
					<template #title>
						<span class="custom-title">检查报告结论</span>
					</template>
					<template #value>
						{{currentData.reportConclusion}}
					</template>
				</van-cell>
				<van-cell>
					<div class="text">检查报告图片</div>
					<div class="images-list">
						<div v-viewer="{movable: false}">
							<img v-for="src in currentData.iconographyPhotosUrl" :src="src" :key="src"
								class="image-item" />
						</div>
					</div>
				</van-cell>
			</van-cell-group>
		</div>
	</div>
</body>
<!-- 上线环境用 -->
<script src="../../common/js/vue.global.prod.js"></script>
<!-- 引入 UI 组件库 -->
<script src="../../common/js/vant.min.js"></script>
<!-- axios 接口调用 -->
<script src="../../common/js/axios.min.js"></script>
<script src="../../base.js"></script>
<!-- viewer 图片预览 -->
<script src="../../common/js/viewer.js"></script>
<script src="../../common/js/index.umd.js"></script>

<script type="module">
	import {
		getAction,
		postAction,
		getUrl,
	} from "../../common/js/api/vue3-axios-utils.js";

	const PatientData = {
		data() {
			return {
				url: {
					getInfo: "/102/12/1021202",
					updateInfo: "/102/12/1021201",
				},
				currentData: {},
				patient_url: "../index.html?userid=",
			};
		},
		created() {
			this.getData().catch((error) => {
				console.log(error);
			});
		},
		methods: {
			async getData() {
				let patientId = localStorage.pid;

				this.patient_url = this.patient_url + patientId;

				let url =
					getUrl() + this.url.getInfo + "?patientId=" + patientId;

				const res = await getAction(url);

				if (res.data.success) {
					this.currentData = await res.data.result;

					this.currentData.iconographyPhotosUrl =
						this.currentData.iconographyPhotosUrl.split(",");
				}
			},
			onClickLeft() {
				window.location.href = "../filesIndex.html";
			},
			onClickRight() {
				window.location.href =
					"../index.html?userid=" + localStorage.pid;
			},
		},
	};

	const app = Vue.createApp(PatientData);

	app.use(vant);

	app.use(VueViewer.default);

	// 通过 CDN 引入时不会自动注册 Lazyload 组件
	// 可以通过下面的方式手动注册
	app.use(vant.Lazyload);

	// 调用函数组件，弹出一个 Toast
	// vant.Toast("刷新成功");

	app.mount("#app");
</script>

</html>
